# Copyright (C) 2006-2008 by Sergio Pistone
# sergio_pistone@yahoo.com.ar
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

require File.expand_path( File.dirname( __FILE__ ) + "/gui.rb" )

if $0 == __FILE__

	GUI.set_run_out_of_process( true )

	# NOTE: qt4 can't be loaded along with qt3 or gtk (no idea why...)
	["qt4"].each() do |toolkit|
# 	["qt4", "tk", "gtk"].each() do |toolkit|

		GUI.set_toolkit_priority( [toolkit] )

		values = { "script_name"=>"script_name", "used_plugins"=>["used1", "used2", "used3", "used4"], "unused_plugins"=>["unused1", "unused2"], "cleanup_lyrics"=>"true", "threaded"=>"false", "write_log"=>"true" }
		GUI.show_plugins_manager_dialog( values )
		values.each() { |key, value| puts "#{key}: #{value}" }

		values = { "artist"=>"artist", "title"=>"title", "lyrics"=>"lyrícs1\nlyrícs2", "site"=>"site" }
		GUI.show_lyrics_dialog( values )
		values.each() { |key, value| puts "#{key}: #{value}" }

		values = { "artist"=>"artist", "title"=>"title", "album"=>"album", "year"=>"1969" }
		GUI.show_search_lyrics_dialog( values )
		values.each() { |key, value| puts "#{key}: #{value}" }

		values = { "site_name"=>"site_name", "submit"=>"true", "review"=>"true", "prompt_autogen"=>"false", "prompt_no_lyrics"=>"false", "username"=>"username", "password"=>"password" }
		GUI.show_wiki_plugin_dialog( values )
		values.each() { |key, value| puts "#{key}: #{value}" }

		values = { "site_name"=>"site_name", "url"=>"url", "artist"=>"artist", "year"=>"1999", "album"=>"album", "title"=>"title", "lyrics"=>"lyrícs1\nlyrícs2", "lyricist"=>"lyricist", "credits"=>"credits", "reviewed"=>"false" }
		GUI.show_submit_song_dialog( values )
		values.each() { |key, value| puts "#{key}: #{value}" }

		values = { "site_name"=>"site_name", "artist"=>"artist", "year"=>"1999", "month"=>"10", "day"=>"14","album"=>"album", "reviewed"=>"false", "image_path"=>"image_path", "tracks"=>"tracks <small>fffff</small>\ntracks <small>fffff</small>" }
		GUI.show_submit_album_dialog( values )
		values.each() { |key, value| puts "#{key}: #{value}" }

		values = { "site_name"=>"site_name", "artist"=>"artist", "year"=>"1999", "month"=>"10", "day"=>"14","album"=>"album", "reviewed"=>"false", "tracks"=>"tracks <small>fffff</small>\ntracks <small>fffff</small>" }
		GUI.show_submit_album_dialog( values )
		values.each() { |key, value| puts "#{key}: #{value}" }

		GUI.show_wiki_fix_pages_dialog( {
			"site_name" => "site_name",
			"title" => "Pages fixer",
			"fetch_func" => "proc { `kdialog --msgbox 'fetch_func'` }",
			"fix_func" => "proc { `kdialog --msgbox 'fix_func'` }",
			"submit_func" => "proc { `kdialog --msgbox 'submit_func'` }"
		} )
		values.each() { |key, value| puts "#{key}: #{value}" }

		values = { "site_name"=>"site_name", "artist"=>"artist", "album"=>"album", "year"=>"year", "image_path" => "image_path" }
		GUI.show_upload_cover_dialog( values )
		values.each() { |key, value| puts "#{key}: #{value}" }

	end

end
